{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Date      0\n",
      "Open      1\n",
      "High      0\n",
      "Low       1\n",
      "Close     0\n",
      "Volume    1\n",
      "dtype: int64\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "C:\\Users\\bww\\AppData\\Local\\Temp\\ipykernel_6960\\3542110406.py:1: DeprecationWarning: \n",
      "Pyarrow will become a required dependency of pandas in the next major release of pandas (pandas 3.0),\n",
      "(to allow more performant data types, such as the Arrow string type, and better interoperability with other libraries)\n",
      "but was not found to be installed on your system.\n",
      "If this would cause problems for you,\n",
      "please provide us feedback at https://github.com/pandas-dev/pandas/issues/54466\n",
      "        \n",
      "  import pandas as pd\n"
     ]
    }
   ],
   "source": [
    "import pandas as pd  \n",
    "import numpy as np  \n",
    "  \n",
    "# 创建一个包含缺失值的示例DataFrame  \n",
    "data = {  \n",
    "    'Date': ['2023-01-01', '2023-01-02', '2023-01-03', '2023-01-04'],  \n",
    "    'Open': [100, 101, np.nan, 103],  \n",
    "    'High': [102, 102, 103, 104],  \n",
    "    'Low': [99, 100, 101, np.nan],  \n",
    "    'Close': [101, 101.5, 102.5, 103.5],  \n",
    "    'Volume': [1000, 1200, 1100, np.nan]  \n",
    "}  \n",
    "df = pd.DataFrame(data)  \n",
    "  \n",
    "# 将'Date'列转换为日期类型（虽然这不是检查缺失值的必要步骤，但通常我们会这么做）  \n",
    "df['Date'] = pd.to_datetime(df['Date'])  \n",
    "  \n",
    "# 使用df.isnull().sum()检查缺失值  \n",
    "missing_values = df.isnull().sum()  \n",
    "print(missing_values)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
